package com.design.composite.football;

import java.util.ArrayList;
import java.util.List;

/**
 * @author xiemiao
 * @description 组
 * @date 2023/08/16
 */
public class Group implements FootballNode {

    private String name;

    private String notice;

    private List<FootballNode> members = new ArrayList<>();

    public void setNotice(String notice) {
        this.notice = notice;
    }

    public Group(String name) {
        this.name = name;
    }

    public void addMember(FootballNode team) {
        members.add(team);
    }

    @Override
    public void display() {
        System.out.println("组：" + name);
        System.out.println("通知:" + notice);
        for (FootballNode member : members) {
            member.display();
        }
    }
}
